﻿using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

namespace YFurion.DataFilters.Extensions
{
    public static class DataFilterServiceCollectionExtensions
    {
        public static IServiceCollection RegisterDataFilter(this IServiceCollection services, string filterName, bool isEnabledByDefault)
        {
            StartupConfiguration.DataFilterOptions.RegisterFilter(filterName, isEnabledByDefault);
            return services;
        }

        public static IApplicationBuilder RegisterDataFilter(this IApplicationBuilder app, string filterName, bool isEnabledByDefault)
        {
            StartupConfiguration.DataFilterOptions.RegisterFilter(filterName, isEnabledByDefault);
            return app;
        }
    }
}
